package cn.itsy.dao;

import cn.itsy.pojo.Companyinfo;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * sj
 */
@Repository
public class CompanyinfoDaoImpl implements CompanyinfoDao {
    @Resource
    private JdbcTemplate jdbctem;

    /**
     * 添加CompanyinfoDao方法
     */
    @Override
    public int insertCompanyinfoDao(String sql) {
        int i = jdbctem.update(sql);
        return i;
    }

    /**
     * 查询方法去重
     */
    @Override
    public List<Companyinfo> selectCompanyinfoDao(String sql) {
        List<Companyinfo> query = jdbctem.query(sql, new BeanPropertyRowMapper<Companyinfo>(Companyinfo.class));
        return query;
    }
}
